package demo1;

import java.util.Arrays;
import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        MyStack myStack = new MyStack();
        myStack.push(1);
        myStack.push(2);
        myStack.push(3);
        myStack.push(4);
        System.out.println(myStack.peek());
        myStack.pop();
        myStack.pop();
        myStack.pop();
        System.out.println(myStack.peek());



    }






    public static void main2(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(12);
        stack.push(23);
        stack.push(34);

        int a = stack.pop();//只能弹最上面的开始，先进后出时栈
        System.out.println(stack);

        int b = stack.peek();
        System.out.println(b);

        System.out.println(stack.size());
    }
}
